syntactic sugar - definition. What is syntactic sugar
Diclib.com
قاموس ChatGPT
أدخل كلمة أو عبارة بأي لغة 👆
اللغة:

ترجمة وتحليل الكلمات عن طريق الذكاء الاصطناعي ChatGPT

في هذه الصفحة يمكنك الحصول على تحليل مفصل لكلمة أو عبارة باستخدام أفضل تقنيات الذكاء الاصطناعي المتوفرة اليوم:

  • كيف يتم استخدام الكلمة في اللغة
  • تردد الكلمة
  • ما إذا كانت الكلمة تستخدم في كثير من الأحيان في اللغة المنطوقة أو المكتوبة
  • خيارات الترجمة إلى الروسية أو الإسبانية، على التوالي
  • أمثلة على استخدام الكلمة (عدة عبارات مع الترجمة)
  • أصل الكلمة

%ما هو (من)٪ 1 - تعريف

SYNTAX WITHIN A PROGRAMMING LANGUAGE THAT IS DESIGNED TO MAKE THINGS EASIER TO READ OR TO EXPRESS
Syntactic salt; Syntactic Sugar; Desugaring; Desugar; Desugarer; Syntax sugar; Syntactic saccharin; Desugared; Syntactical sugar

syntactic sugar         
Term coined by Peter Landin for additions to the syntax of a language which do not affect its expressiveness but make it "sweeter" for humans to use. Syntactic sugar gives the programmer an alternative way of coding that is more succinct or more like some familiar notation. It does not affect the expressiveness of the formalism (compare chrome). Syntactic sugar can be easily translated ("desugared") to produce a program in some simpler "core" syntax. E.g. C's "a[i]" notation is syntactic sugar for "*(a + i)". In a (curried) functional language, all operators are really functions and the use of infix notation "x+y" is syntactic sugar for function application "(+) x y". Alan Perlis once quipped, "Syntactic sugar causes cancer of the semicolon." The variants "syntactic saccharin" and "syntactic syrup" are also recorded. These denote something even more gratuitous, in that they serve no purpose at all. Compare candygrammar, syntactic salt.
Syntactic sugar         
In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer.
syntactic salt         
The opposite of syntactic sugar, a feature designed to make it harder to write bad code. Specifically, syntactic salt is a hoop the programmer must jump through just to prove that he knows what's going on, rather than to express a program action. Some programmers consider required type declarations to be syntactic salt. A requirement to write "end if", "end while", "end do", etc. to terminate the last block controlled by a control construct (as opposed to just "end") would definitely be syntactic salt. Syntactic salt is like the real thing in that it tends to raise hackers' blood pressures in an unhealthy way. Compare candygrammar. [Jargon File]

ويكيبيديا

Syntactic sugar

In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer. Syntactic sugar is usually a shorthand for a common operation that could also be expressed in an alternate, more verbose, form: The programmer has a choice of whether to use the shorter form or the longer form, but will usually use the shorter form since it is shorter and easier to type and read.

For example, many programming languages provide special syntax for referencing and updating array elements. Abstractly, an array reference is a procedure of two arguments: an array and a subscript vector, which could be expressed as get_array(Array, vector(i,j)). Instead, many languages provide syntax such as Array[i,j]. Similarly an array element update is a procedure consisting of three arguments, for example set_array(Array, vector(i,j), value), but many languages also provide syntax such as Array[i,j] = value.

A construct in a language is syntactic sugar if it can be removed from the language without any effect on what the language can do: functionality and expressive power will remain the same.

Language processors, including compilers and static analyzers, often expand sugared constructs into their more verbose equivalents before processing, a process sometimes called "desugaring".